package com.gege.homework2;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author gechenpeng
 * @date 2021-04-16
 */
public class Demo {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        Student student1 = (Student) context.getBean("student1");
        System.out.println(student1);

        Student student2 = (Student) context.getBean("student2");
        System.out.println(student2);

        Klass klass = context.getBean(Klass.class);
        System.out.println(klass);

        ISchool school = context.getBean(ISchool.class);
        school.doSomething();
    }
}
